#! /bin/sh
#
# $Id: pkg-install 74 2006-08-18 16:57:17Z lwhsu $
#

LN="/bin/ln"
SHELLS="${PKG_DESTDIR-}/etc/shells"

if [ $2 != "POST-INSTALL" ]; then
  exit 0
fi

for i in bash ksh zsh
do
  if [ -f ${LOCALBASE}/bin/${i} ]; then
    ${LN} -fs ${LOCALBASE}/bin/${i} /bin/${i}
  fi
  if [ -d "${SHELLS%/*}" ] && ! grep -qs "^/bin/${i}\$" "$SHELLS"; then
    echo "/bin/${i}" >> "${SHELLS}"
  fi
done
